package com.mall.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.mall.task.hook.ShutdownHook;



/**
 * is_zhoufeng
 *
 */
public class StartUp {
	private static final Logger log = LoggerFactory.getLogger(StartUp.class);
	
    public static void main( String[] args ) throws InterruptedException
    {
    	
    	
		ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml"); 
    	log.info("jingcai-scheduler启动成功！");
    	
    	/**
    	 * 服务退出前可以执行ShutdownHook中的内容
    	 */
    	Runtime.getRuntime().addShutdownHook(new ShutdownHook(applicationContext)); 
    	
    }
}
